<?php

	class FlashWidget extends EbWidget
	{
		public function render()
		{
			$module = $this->module;
			$file 	= $this->file;
			
			$width	= isset($this->width) ? $this->width : '100%';
			$height	= isset($this->height) ? $this->height : '100%';
			
			EbView::includeEbuildyJavascript('swfobject');
						
			echo '
<div id="eb-gallery" style="width:'.$width.';height:'.$height.'">
<h1>No flash player!</h1>
<p>You must install the flash Flash to see this animation: <a href="http://www.macromedia.com/go/getflashplayer" >Click here</a> to go to Macromedia download page.</p>
</div>
<script language="javascript" type="text/javascript">
var so = new SWFObject("'.EbApplication::getConfig('moduleurl').'/'.$module.'/v/'.$file.'.swf", "gallery", "'.$width.'", "'.$height.'", "8"); // Location of swf file. You can change gallery width and height here (using pixels or percents).
so.addParam("quality", "high");
so.addParam("allowFullScreen", "true");
';
			
			if (isset($this->variables))
			{
				foreach ($this->variables AS $key=>$value)
				{
					echo 'so.addVariable("'.$key.'","'.$value.'");';
				}
			}

echo '
so.write("eb-gallery");
</script>
';
			
		}	
	}

?>